//
//  InspectionCell.m
//  云律司
//
//  Created by 韦淋 on 2017/7/5.
//  Copyright © 2017年 test. All rights reserved.
//

#import "InspectionCell.h"

@implementation InspectionCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initalizeInterface];
    }
    return self;
}
- (void)initalizeInterface{
    [self.contentView addSubview:self.bgView];
    [self.bgView addSubview:self.lineView];
    [self.bgView addSubview:self.titleLable];
    [self.bgView addSubview:self.caseOrgans];
    [self.bgView addSubview:self.caseNumber];
    [self.bgView addSubview:self.department];
    [self.bgView addSubview:self.undertaker];
    [self.bgView addSubview:self.lockUpTime];
    [self.bgView addSubview:self.arrestTime];
}
- (void)layoutSubviews{
    
    
    self.bgView.frame = CGRectMake(5, 0, self.contentView.bounds.size.width - 10, self.contentView.bounds.size.height - 15);
    self.lineView.frame = CGRectMake(0, 0, self.bgView.bounds.size.width , 2);
    self.titleLable.frame = CGRectMake(10, 0, 300, 40);
    self.caseOrgans.frame = CGRectMake(40, 40, 350, 25);
    self.caseNumber.frame = CGRectMake(40, 65, 350, 25);
    self.department.frame = CGRectMake(40, 90, 350, 25);
    self.undertaker.frame = CGRectMake(40, 115, 350, 25);
    self.lockUpTime.frame = CGRectMake(40, 140, 350, 25);
    self.arrestTime.frame = CGRectMake(40, 165, 350, 25);
    for (int i = 0; i < 6; i ++) {
        UIView *dividerView = [[UIView alloc] initWithFrame:CGRectMake(0, 40 + i * 25, self.bgView.bounds.size.width , 0.5)];
        dividerView.backgroundColor = [UIColor colorWithRed:238.0f/255.0f green:238.0f/255.0f blue:238.0f/255.0f alpha:1.0f];
        [self.bgView addSubview:dividerView];
        
        NSArray *array = [NSArray array];
        array = @[@"llist_0011",@"llist_0010",@"llist_0012",@"bann_03",@"llist_004",@"llist_004"];
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 42 + i * 25, 20, 20)];
        //        imageView.backgroundColor = [UIColor redColor];
        imageView.image = [UIImage imageNamed:array[i]];
        
        [self.bgView addSubview:imageView];
    }
    
    
}

- (UIView *)bgView{
    if (!_bgView) {
        _bgView = [[UIView alloc] init];
        _bgView.backgroundColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f];
        //        _bgView.layer.cornerRadius=10;
        _bgView.layer.shadowColor=[UIColor lightGrayColor].CGColor;
        _bgView.layer.shadowOffset=CGSizeMake(3, 3);
        _bgView.layer.shadowOpacity=0.5;
        //        _bgView.layer.shadowRadius=5;
        //        CGPathRef path = [UIBezierPath bezierPathWithRect:CGRectMake(0, self.bounds.size.height, [UIScreen mainScreen].bounds.size.width,2)].CGPath;
        //        [_bgView setShadowPath:path];
    }
    return _bgView;
}
- (UIView *)lineView{
    if (!_lineView) {
        _lineView = [[UIView alloc] init];
        _lineView.backgroundColor = [UIColor colorWithRed:63.0f/255.0f green:189.0f/255.0f blue:240.0f/255.0f alpha:1.0f];
    }
    return _lineView;
}
- (UILabel *)titleLable{
    if (!_titleLable) {
        _titleLable = [[UILabel alloc]init];
        _titleLable.textColor = [UIColor blackColor];
        _titleLable.font = [UIFont systemFontOfSize:16];
    }
    return _titleLable;
}
- (UILabel *)caseOrgans{
    if (!_caseOrgans) {
        _caseOrgans = [[UILabel alloc]init];
        _caseOrgans.textColor = [UIColor blackColor];
        _caseOrgans.font = [UIFont systemFontOfSize:11];
    }
    return _caseOrgans;
}
- (UILabel *)caseNumber{
    if (!_caseNumber) {
        _caseNumber = [[UILabel alloc]init];
        _caseNumber.textColor = [UIColor blackColor];
        _caseNumber.font = [UIFont systemFontOfSize:11];
    }
    return _caseNumber;
}

- (UILabel *)department{
    if (!_department) {
        _department = [[UILabel alloc]init];
        _department.textColor = [UIColor blackColor];
        _department.font = [UIFont systemFontOfSize:11];
    }
    return _department;
}
- (UILabel *)undertaker{
    if (!_undertaker) {
        _undertaker = [[UILabel alloc]init];
        _undertaker.textColor = [UIColor blackColor];
        _undertaker.font = [UIFont systemFontOfSize:11];
    }
    return _undertaker;
}- (UILabel *)lockUpTime{
    if (!_lockUpTime) {
        _lockUpTime = [[UILabel alloc]init];
        _lockUpTime.textColor = [UIColor blackColor];
        _lockUpTime.font = [UIFont systemFontOfSize:11];
    }
    return _lockUpTime;
}- (UILabel *)arrestTime{
    if (!_arrestTime) {
        _arrestTime = [[UILabel alloc]init];
        _arrestTime.textColor = [UIColor blackColor];
        _arrestTime.font = [UIFont systemFontOfSize:11];
    }
    return _arrestTime;
}
@end
